<{include file="section/admin/admin_header.tpl"}>
<script type="text/javascript" src="<{$smarty.const._DOMAIN_SC_CDN_}>/upload/zx/sc/js/highslide/highslide-with-html.js"></script>
<link rel="stylesheet" type="text/css" href="<{$smarty.const._DOMAIN_SC_CDN_}>/upload/zx/sc/js/highslide/highslide.css" />
<script type="text/javascript">
hs.graphicsDir = '<{$smarty.const._DOMAIN_SC_CDN_}>/upload/zx/sc/js/highslide/graphics/';
hs.outlineType = 'rounded-white';
hs.wrapperClassName = 'draggable-header';
</script>
<style type="text/css">
/* lab */
/* add.05.13 star */
.lab01{background:url(http://cms.f.itc.cn/upload/ihome/images/admin_bg01.gif) repeat-x 0 0 #fff;height:30px;}
.lab01 li{padding:3px 16px 0 15px;float:left;line-height:26px;color:#00a100;background:url(http://cms.f.itc.cn/upload/ihome/images/admin_bg01.gif) no-repeat 100% -31px #fff;cursor:pointer}
.lab01 li.active{margin-left:-1px;border-left:1px solid #ddd; background:url(http://cms.f.itc.cn/upload/ihome/images/admin_bg01.gif) no-repeat 100% -60px #f6f6f6;padding-bottom:1px;color:#333;font-weight:bold;cursor:auto}
.lab01 li.bgnone{background:none}
.lab01 span.right{line-height:30px;margin-right:10px;display:inline}
/* add.05.13 end */
.lab03{height:38px;line-height:38px;color:#aaa}
.lab03 a, .lab03 a:hover{ text-decoration:underline;color:#00a100}

</style>
<style type="text/css">
		#tab{
		}
		#tab li{
			float:left;
			font-size:16px;
			color:#034795;
			background:none;
			/*border-bottom:1px solid #E1E1E1;*/
			padding:5px 10px 2px 10px;
			cursor:pointer;
		}
		#tab li._active{
			color:#FFFFFF;
			cursor:default;
			background:#00A100;
			border-top:1px solid #E1E1E1;
			border-left:1px solid #E1E1E1;
			border-right:1px solid #E1E1E1;
			/*border-bottom:1px solid #FAFAFA;*/
		}
		#tab li._line{
			height:16px;
			width:539px;;
			background:none;
			border-top:1px solid transparent;
			border-bottom:1px solid #E1E1E1;
			cursor:default;
		}
		</style>

<body>
<{include file="section/admin/admin_header_login_bar.tpl"}>
<div id="contentA" class="clear" style="width:1300px;">
	<!--leftsidebar sr-->
	<{include file="section/admin/admin_left_sidebar.tpl"}>
    <!--/leftsidebar end-->
    <div class="rightCont">
    	<!--path st-->
		<div class="path">您的位置：<a href="/">首页</a>&gt; 品牌推荐列表</div>
		<!--/path end-->
		
		<{$message}>

    	<h2 class="title01"><span>品牌推荐列表</span></h2>
        <div class="line1"></div>
		<div class="box02">
			<{include file="admin/home/brandnavigator.tpl"}>	
			<ul> &nbsp;</ul>
		<!--	<form id="frm" action="/recommend/addbrand" method="post">-->
				<input type="hidden" value="" name="login_name">
				<input type="hidden" value="add" name="action">
				<input type="hidden" value="<{$status}>" name="status">
				<input type="hidden" value="" name="num" id="num">
				<input type="hidden" value="" name="brand_id" id="brand_id">
				<div class="box02_1">
					<div class="box_Tab">
						<div class="table01">
                    	<table cellpadding="0" cellspacing="0" width="100%" border="0" id="table">
                        <tr class="th">
                        <th><div>ID</div></th>
						<th><div class="tl">品牌名称</div></th>
						<th><div>品牌申请人</div></th>
                        <th><div>创建时间</div></th>
						<th><div>排序</div></th>
						<th><div>操作</div></th>
                        </tr>

						<{foreach from=$data key=key item=item}>
						<tr>
						<td><{$item.id}></td>
						<td class="tl"><{if $item.logo_url}><a href="<{$item.logo_url}>" target="_blank"><{/if}><{$item.name}><{if $item.logo_url}></a><{/if}></td>
						<td><{$item.apply_uname}></td>
						<td><{$item.create_time}></td>
						<td><div id="view_<{$item.id}>" name="view_<{$item.id}>"><{$item.num}></div></td>
						<td><a href="" onclick="return hs.htmlExpand(this)">推荐到首页</a><div class="highslide-maincontent">
						排序：<input type="text" name="num_<{$item.id}>" id="num_<{$item.id}>" value="<{$item.num}>" />
						<input type="button" name="onsubmit" value="提交" onclick="goto_su(<{$item.id}>)"/>
						</div> | <a href="javascript:void(0);" onclick="goto_cancel(<{$item.recommend_id}>)" >取消</a></td>
                        </tr>
						<{/foreach}>

                        </table>
					    </div>
					</div>
                </div>
                <div class="box02_lab clear">
                </div>
			<!--</form>-->
        </div>
       总计: <{$total}> <{$pagination}> 
    </div>
</div>
</body>
<script type="text/javascript">
var frm = document.getElementById('frm');

function goto_cancel(id)
{
	var id	= parseInt(id);

	if(id <= 0)
	{
		alert('参数错误'); return false;
	}
	
	$.post('/recommend/delrecommend/',
	{
		del_id		: id
	},
	function(o){

		//alert(o);

		window.location.href = window.location.href;
	},
	'html'
	); 
}

function goto_su(brand_id)
{
	var brand_id	= parseInt(brand_id);

	if(brand_id <= 0)
	{
		alert("参数错误！");

		return false;
	}

	var num	= document.getElementById("num_" + brand_id).value;

	document.getElementById("num").value	= num;

	document.getElementById("brand_id").value = brand_id;


	var brand_status = '<{$status}>';

	$.post('/recommend/addbrand/',
	{
		num				: num,
		brand_status	: brand_status,
		brand_id		: brand_id
	},
	function(o){

		//alert(o);
		
		window.location.href = window.location.href;

		//document.getElementById("view_" + brand_id).innerHTML = num;
	},
	'html'
	); 
}
</script>
</html>
